package com.sun.enhanceelasticsearch.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Document(indexName = "user_info",shards = 3,replicas = 0)   //文档
@Data
public class UserInfo implements Serializable {

    @Id
    private Integer id;
    @Field(type = FieldType.Text)
    private String phone;
    @Field(type = FieldType.Text)
    private String password;
    @Field(type = FieldType.Text)
    private String nickName;
    @Field(type = FieldType.Text)
    private String icon;
    @Field(type = FieldType.Date,format = DateFormat.date_time)
    private Date createTime;
    @Field(type = FieldType.Date,format = DateFormat.date_time)
    private Date updateTime;
    //存放高亮内容
    private String requestBody;

}
